//
//  QKAlertManager.h
//  QKiOS
//
//  Created by lushitong on 2018/12/14.
//  Copyright © 2018年 qingka. All rights reserved.
//

#import "QKBaseAlertManager.h"

#define BFBaseAlertManagerDeprecatedInfo(info) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, info)

#define BFBaseAlertManagerDeprecatedSuperView NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, "请使用带superView参数的方法")


@interface QKAlertManager : QKBaseAlertManager

/**
 *               ***********手动退出的方式***********
 *
 * 1、有JKAlertView对象，直接 alertView.dismiss();
 *
 * 2、有JKAlertAction对象，直接 action.alertView.dismiss();
 *
 * 3、给JKAlertView对象设置alertView.setDismissKey(@"key");可以使用类方法JKAlertView.dismissForKey(@"key");退出
 *
 * 4、[BFBaseAlertManager dismissAll]; // 本质是发一个通知给当前所有的JKAlertView，让其执行消失操作，如非必须不建议使用
 */




/**
 * 自定义JKAlertView支持的任意样式弹框
 */
+ (void)showWithSuperView:(UIView *)superView
					title:(NSString *)title
				  message:(NSString *)message
					style:(JKAlertStyle)style
		 configBeforeShow:(void(^)(JKAlertView *alertView))config;

/**
 * 自定义JKAlertView支持的任意样式弹框
 */
+ (void)showWithSuperView:(UIView *)superView
		  attributedTitle:(NSAttributedString *)attributedTitle
		attributedMessage:(NSAttributedString *)attributedMessage
					style:(JKAlertStyle)style
		 configBeforeShow:(void(^)(JKAlertView *alertView))config;

/**
 * 显示一个普通的无取消按钮的弹框
 * superView : 自定义superView，传nil则添加到keywindow
 * verifyTitle : 确认的文字，传nil表示没有下方按钮
 */
+ (void)showWithSuperView:(UIView *)superView
					title:(NSString *)title
				  message:(NSString *)message
			  verifyTitle:(NSString *)verifyTitle
			 verifyAction:(void(^)(void))verifyAction;

/**
 * 自定义弹框，添加输入框等
 * 注意这里点击确认不会自动消失，需要手动消失 action.alertView.dismiss();
 * verifyTitle : 确认的文字，传nil表示没有下方按钮
 * closeAction : 点击叉号的操作
 * configBeforeShow : 用来自定义，比如添加输入框
 */
+ (void)showCustomWithTitle:(NSString *)title
				verifyTitle:(NSString *)verifyTitle
				closeAction:(void(^)(void))closeAction
			   verifyAction:(void(^)(JKAlertAction *action))verifyAction
		   configBeforeShow:(void(^)(JKAlertView *alertView))config;


/**
 * 显示密码框
 * 注意这里点击确认不会自动消失，需要手动消失 action.alertView.dismiss();
 */
+ (void)showPasswordAlertWithVerifyTitle:(NSString *)verifyTitle
						 textFieldConfig:(void(^)(UITextField *textField))textFieldConfig
							 closeAction:(void(^)(void))closeAction
							verifyAction:(void(^)(JKAlertAction *action, NSString *password))verifyAction BFBaseAlertManagerDeprecatedSuperView;

/**
 * 显示密码框
 * superView : 自定义superView，传nil则添加到keywindow
 * 注意这里点击确认不会自动消失，需要手动消失 action.alertView.dismiss();
 * configBeforeShow : 在show之前对一些特殊弹框做些配置，不需要直接传nil
 */
+ (void)showPasswordWithSuperView:(UIView *)superView
					  verifyTitle:(NSString *)verifyTitle
				  textFieldConfig:(void(^)(UITextField *textField))textFieldConfig
					  closeAction:(void(^)(void))closeAction
					 verifyAction:(void(^)(JKAlertAction *action, NSString *password))verifyAction
				 configBeforeShow:(void(^)(JKAlertView *alertView))config;

/**
 * 显示普通文字弹框，默认行间距为5
 * superView   : 自定义superView，传nil则添加到keywindow
 * cancelTitle : 取消的文字，传nil代表没有取消按钮
 * verifyTitle : 确定的文字，和cancelTitle同时传nil表示没有下方按钮
 * configBeforeShow : 在show之前对一些特殊弹框做些配置，不需要直接传nil
 */
+ (void)showWithSuperView:(UIView *)superView
					title:(NSString *)title
				  message:(NSString *)message
			  cancelTitle:(NSString *)cancelTitle
			  verifyTitle:(NSString *)verifyTitle
			 verifyAction:(void(^)(JKAlertAction *action))verifyAction
		 configBeforeShow:(void(^)(JKAlertView *alertView))config;

/**
 * 显示普通文字弹框，默认行间距为5
 * superView   : 自定义superView，传nil则添加到keywindow
 * cancelTitle : 取消的文字，传nil代表没有取消按钮
 * verifyTitle : 确定的文字，和cancelTitle同时传nil表示没有下方按钮
 * isAutoDimiss : 点击确定是否自动消失
 * configBeforeShow : 在show之前对一些特殊弹框做些配置，不需要直接传nil
 */
+ (void)showWithSuperView:(UIView *)superView
					title:(NSString *)title
				  message:(NSString *)message
			  cancelTitle:(NSString *)cancelTitle
			  verifyTitle:(NSString *)verifyTitle
			 isAutoDimiss:(BOOL)isAutoDimiss
			  closeAction:(void(^)(void))closeAction
			 cancelAction:(void(^)(JKAlertAction *action))cancelAction
			 verifyAction:(void(^)(JKAlertAction *action))verifyAction
		 configBeforeShow:(void(^)(JKAlertView *alertView))config;

/**
 * 显示富文本弹框
 * superView    : 自定义superView，传nil则添加到keywindow
 * cancelTitle : 取消的文字，传nil代表没有取消按钮
 * verifyTitle : 确认的文字，和cancelTitle同时传nil表示没有下方按钮
 * configBeforeShow : 在show之前对一些特殊弹框做些配置，不需要直接传nil
 */
+ (void)showWithSuperView:(UIView *)superView
		  attributedTitle:(NSAttributedString *)attributedTitle
		attributedMessage:(NSAttributedString *)attributedMessage
			  cancelTitle:(NSString *)cancelTitle
			  verifyTitle:(NSString *)verifyTitle
			 verifyAction:(void(^)(JKAlertAction *action))verifyAction
		 configBeforeShow:(void(^)(JKAlertView *alertView))config;

/**
 * 显示富文本弹框
 * superView    : 自定义superView，传nil则添加到keywindow
 * cancelTitle  : 取消的文字，传nil代表没有取消按钮
 * verifyTitle  : 确定的文字，和cancelTitle同时传nil表示没有下方按钮
 * isAutoDimiss : 点击确定否自动消失
 * configBeforeShow : 在show之前对一些特殊弹框做些配置，不需要直接传nil
 */
+ (void)showWithSuperView:(UIView *)superView
		  attributedTitle:(NSAttributedString *)attributedTitle
		attributedMessage:(NSAttributedString *)attributedMessage
			  cancelTitle:(NSString *)cancelTitle
			  verifyTitle:(NSString *)verifyTitle
			 isAutoDimiss:(BOOL)isAutoDimiss
			  closeAction:(void(^)(void))closeAction
			 cancelAction:(void(^)(JKAlertAction *action))cancelAction
			 verifyAction:(void(^)(JKAlertAction *action))verifyAction
		 configBeforeShow:(void(^)(JKAlertView *alertView))config;
@end

